import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        // 读取方程组的元数n
        int n = scanner.nextInt();
        
        // 创建一个二维数组来存储系数和常数
        int [][] coefficients = new int[n][n + 1];
        
        // 读取系数和常数
        for (int i = 0; i < n; i++) {
            for (int j = 0; j <= n; j++) {
                coefficients[i][j] = scanner.nextDouble();
            }
        }
        
        // 输出格式化后的二维数组
        System.out.println(Arrays.deepToString(coefficients));
        
        // 输出每个方程的系数和常数
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                System.out.print(coefficients[i][j] + " ");
            }
            System.out.print("= " + coefficients[i][n]);
            System.out.println();
        }
        
        scanner.close();
    }
}